package com.xujl.mvcbind.util;

import android.app.Activity;
import android.view.View;

import com.gyf.immersionbar.ImmersionBar;

import androidx.fragment.app.Fragment;
import qiu.niorgai.StatusBarCompat;

/**
 * 状态栏适配
 */
public class StatusBarHelper {
    public static void setStatusBarColor (Activity activity, int color) {
        StatusBarCompat.setStatusBarColor(activity, color);
        StatusBarCompat.changeToLightStatusBar(activity);
    }

    public static void setTranslucent (Fragment fragment, View titleBar) {
        ImmersionBar.with(fragment)
                .transparentStatusBar()
                .titleBarMarginTop(titleBar)
                .fitsSystemWindows(true)
                .statusBarDarkFont(true)
                .init();

    }

    public static void setTranslucent (Activity activity, View titleBar) {
        ImmersionBar.with(activity)
                .transparentStatusBar()
                .titleBarMarginTop(titleBar)
                .fitsSystemWindows(true)
                .statusBarDarkFont(true)
                .init();

    }
}
